<template>
	<view>
		<map style="width: 100vw; height: 100vh;" :latitude="latitude" :longitude="longitude" :markers="markers" :polyline="polyline">
		</map>
	</view>
</template>

<script>
	import Amap from '@/js/lyn4ever-gaode.js';
	export default {
		data() {
			return {
				longitude: 108.921672,
				latitude: 34.250646,
				markers: [],
				polyline: []
			}
		},
		onLoad() {
			let that = this;
			var startPoi = "108.921672,34.250646";
			var wayPoi =
				"108.936799,34.245842;108.973306,34.244767;109.013335,34.249303";
			var endPoi = "109.033673,34.252884";
			
			Amap.line(startPoi, endPoi, wayPoi,function(res){
				that.polyline.push(res)
			});
		
			Amap.markers(startPoi,endPoi,wayPoi,function(res){
				that.markers.push.apply(that.markers,res)
			})
		},
		methods: {

		}
	}
</script>

<style>

</style>
